package book;

public class BookList {
    //书架大小
    private static  final int DEFAULE_SIZE = 10;
    //书架
    private Book[] books = new Book[DEFAULE_SIZE];
    //书架使用情况
    private int useSize;
    //默认书架存书情况
   public BookList() {
       books[0] = new Book("朝花夕拾","鲁迅",25,"小说");
       books[1] = new Book("阿Q正传","鲁迅",30,"小说");
       books[2] = new Book("三国演义","罗贯中",50,"小说");
       books[3] = new Book("从你的全世界路过","韩寒",30,"小说");
       this.useSize = 4;
   }

    public Book getBooks(int pos) {
        return books[pos];
    }

    public void setBooks(int pos,Book book) {
       this.books[pos]=book;
   }

    public void setBooks(Book book) {
        this.books[useSize] = book;
    }

    public int getUseSize() {
        return useSize;
    }

    public void setUseSize(int useSize) {
        this.useSize = useSize;
    }
}
